package com.xuecheng.teaching.convert;

import com.xuecheng.api.teaching.model.dto.WorkDTO;
import com.xuecheng.api.teaching.model.vo.WorkVo;
import com.xuecheng.teaching.entity.Work;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created on 2021/04/20/16:50 周二
 *
 * @author Lantin
 */

@Mapper
public interface WorkConvert {


    WorkConvert INSTANCE = Mappers.getMapper(WorkConvert.class);


    @Mapping(source = "id", target = "workId")
    WorkDTO workToDTO(Work work);

    @Mapping(source = "workId", target = "id")
    Work dtoToWork(WorkDTO dto);

    WorkDTO workVoToDTO(WorkVo vo);


    List<WorkDTO> workToDTOList(List<Work> list);

}
